package com.alisoft.nano.seda;


/**
 * This interface expose the APIs used in MBean monitoring.
 * 
 * @author zhimin.chenzm, anping.yinap
 *
 */
public interface StageMBean extends MBeanEnable{
    
    /**
     * 
     * @return the count of pending event which is not running at this stage.  
     */
	int getPendingEventCount();

	/**
	 * Set the maximum size of the thread pool to process the event.
	 * 
	 * @param maxSize
	 */
	void setMaximumPoolSize(int maxSize);

	/**
	 * 
	 * 
	 * @return the maximum size of the thread pool to process the event.
	 */
	int getMaximumPoolSize();

	/**
	 * 
	 * @return the default timeout to wait when posting a new event to this stage. (in seconds)
	 */
	long getDefaultTimeout();

	/**
	 * Set the default timeout to wait when posting a new event to this stage. (in seconds)
	 * @param timeout
	 */
	void setDefaultTimeout(long timeout);

	/**
	 *  
	 * @return the size of the batch events which the worker polls from the event queue and process them in the thread pool. 
	 */
	int getBatchSize();

	/**
	 * Set the size of the batch events which the worker polls from the event queue and process them in the thread pool.
	 * @param batchSize
	 */
	void setBatchSize(int batchSize);
	
	/**
	 * 
	 * @return the active threads in the thread pool
	 */
	int getActiveThreads();
}
